package com.sx.controller;

import com.github.pagehelper.PageInfo;
import com.sx.domain.Resource;
import com.sx.domain.ResourceVo;
import com.sx.domain.ResponseResult;
import com.sx.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/resource")
public class ResourceController {
    @Autowired
    private ResourceService resourceService;
    /**
     * 分页与条件查询
     * */
    @RequestMapping("/findAllResource")
    public ResponseResult findAllResource(@RequestBody ResourceVo resourceVo){
        PageInfo<Resource> allResource =
                resourceService.findAllResource(resourceVo);
        ResponseResult responseResult = new ResponseResult(true,200,"响应成功",allResource);
        return responseResult;
    }
}

